/*
 * @Author: PanZhangOne
 * @Date: 2017-12-17 13:43:47
 * @Last Modified by:   PanZhangOne
 * @Last Modified time: 2017-12-17 13:43:47
 */
const os = require('os');

const systemInfo = () => {
  let datas = [];
  datas.push(
    { name: '系统', info: os.arch() },
    { name: 'CPU', info: `${os.cpus()[0].model} * ${os.cpus().length}` },
    { name: '内存', info: `${(os.freemem() / 1024 / 1024 / 1024).toFixed(2)} / ${(os.totalmem() / 1020 / 1024 / 1024).toFixed(2)} G` },
    { name: '上线时间', info: os.uptime() }
  );

  return Promise.resolve(datas);
};

module.exports = {
  systemInfo
};
